\(\int \frac {1}{\sqrt {a+b x+c x^2} (d+e x+f x^2)} \, dx\) [117]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F(-2)]
   Giac [F(-1)]
   Mupad [F(-1)]

Optimal result

Integrand size = 27, antiderivative size = 374 \[ \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+e x+f x^2\right )} \, dx=-\frac {\sqrt {2} f \text {arctanh}\left (\frac {4 a f-b \left (e-\sqrt {e^2-4 d f}\right )+2 \left (b f-c \left (e-\sqrt {e^2-4 d f}\right )\right ) x}{2 \sqrt {2} \sqrt {c e^2-2 c d f-b e f+2 a f^2-(c e-b f) \sqrt {e^2-4 d f}} \sqrt {a+b x+c x^2}}\right )}{\sqrt {e^2-4 d f} \sqrt {c e^2-2 c d f-b e f+2 a f^2-(c e-b f) \sqrt {e^2-4 d f}}}+\frac {\sqrt {2} f \text {arctanh}\left (\frac {4 a f-b \left (e+\sqrt {e^2-4 d f}\right )+2 \left (b f-c \left (e+\sqrt {e^2-4 d f}\right )\right ) x}{2 \sqrt {2} \sqrt {c e^2-2 c d f-b e f+2 a f^2+(c e-b f) \sqrt {e^2-4 d f}} \sqrt {a+b x+c x^2}}\right )}{\sqrt {e^2-4 d f} \sqrt {c e^2-2 c d f-b e f+2 a f^2+(c e-b f) \sqrt {e^2-4 d f}}} \]

[Out]

-f*arctanh(1/4*(4*a*f+2*x*(b*f-c*(e-(-4*d*f+e^2)^(1/2)))-b*(e-(-4*d*f+e^2)^(1/2)))*2^(1/2)/(c*x^2+b*x+a)^(1/2)
/(c*e^2-2*c*d*f-b*e*f+2*a*f^2-(-b*f+c*e)*(-4*d*f+e^2)^(1/2))^(1/2))*2^(1/2)/(-4*d*f+e^2)^(1/2)/(c*e^2-2*c*d*f-
b*e*f+2*a*f^2-(-b*f+c*e)*(-4*d*f+e^2)^(1/2))^(1/2)+f*arctanh(1/4*(4*a*f-b*(e+(-4*d*f+e^2)^(1/2))+2*x*(b*f-c*(e
+(-4*d*f+e^2)^(1/2))))*2^(1/2)/(c*x^2+b*x+a)^(1/2)/(c*e^2-2*c*d*f-b*e*f+2*a*f^2+(-b*f+c*e)*(-4*d*f+e^2)^(1/2))
^(1/2))*2^(1/2)/(-4*d*f+e^2)^(1/2)/(c*e^2-2*c*d*f-b*e*f+2*a*f^2+(-b*f+c*e)*(-4*d*f+e^2)^(1/2))^(1/2)

Rubi [A] (verified)

Time = 0.18 (sec) , antiderivative size = 374, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {997, 738, 212} \[ \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+e x+f x^2\right )} \, dx=\frac {\sqrt {2} f \text {arctanh}\left (\frac {4 a f+2 x \left (b f-c \left (\sqrt {e^2-4 d f}+e\right )\right )-b \left (\sqrt {e^2-4 d f}+e\right )}{2 \sqrt {2} \sqrt {a+b x+c x^2} \sqrt {2 a f^2+\sqrt {e^2-4 d f} (c e-b f)-b e f-2 c d f+c e^2}}\right )}{\sqrt {e^2-4 d f} \sqrt {2 a f^2+\sqrt {e^2-4 d f} (c e-b f)-b e f-2 c d f+c e^2}}-\frac {\sqrt {2} f \text {arctanh}\left (\frac {4 a f+2 x \left (b f-c \left (e-\sqrt {e^2-4 d f}\right )\right )-b \left (e-\sqrt {e^2-4 d f}\right )}{2 \sqrt {2} \sqrt {a+b x+c x^2} \sqrt {2 a f^2-\sqrt {e^2-4 d f} (c e-b f)-b e f-2 c d f+c e^2}}\right )}{\sqrt {e^2-4 d f} \sqrt {2 a f^2-\sqrt {e^2-4 d f} (c e-b f)-b e f-2 c d f+c e^2}} \]

[In]

Int[1/(Sqrt[a + b*x + c*x^2]*(d + e*x + f*x^2)),x]

[Out]

-((Sqrt[2]*f*ArcTanh[(4*a*f - b*(e - Sqrt[e^2 - 4*d*f]) + 2*(b*f - c*(e - Sqrt[e^2 - 4*d*f]))*x)/(2*Sqrt[2]*Sq
rt[c*e^2 - 2*c*d*f - b*e*f + 2*a*f^2 - (c*e - b*f)*Sqrt[e^2 - 4*d*f]]*Sqrt[a + b*x + c*x^2])])/(Sqrt[e^2 - 4*d
*f]*Sqrt[c*e^2 - 2*c*d*f - b*e*f + 2*a*f^2 - (c*e - b*f)*Sqrt[e^2 - 4*d*f]])) + (Sqrt[2]*f*ArcTanh[(4*a*f - b*
(e + Sqrt[e^2 - 4*d*f]) + 2*(b*f - c*(e + Sqrt[e^2 - 4*d*f]))*x)/(2*Sqrt[2]*Sqrt[c*e^2 - 2*c*d*f - b*e*f + 2*a
*f^2 + (c*e - b*f)*Sqrt[e^2 - 4*d*f]]*Sqrt[a + b*x + c*x^2])])/(Sqrt[e^2 - 4*d*f]*Sqrt[c*e^2 - 2*c*d*f - b*e*f
 + 2*a*f^2 + (c*e - b*f)*Sqrt[e^2 - 4*d*f]])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 738

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 997

Int[1/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> With[{q = Rt[
b^2 - 4*a*c, 2]}, Dist[2*(c/q), Int[1/((b - q + 2*c*x)*Sqrt[d + e*x + f*x^2]), x], x] - Dist[2*(c/q), Int[1/((
b + q + 2*c*x)*Sqrt[d + e*x + f*x^2]), x], x]] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[e
^2 - 4*d*f, 0] && NeQ[c*e - b*f, 0] && PosQ[b^2 - 4*a*c]

Rubi steps \begin{align*} \text {integral}& = \frac {(2 f) \int \frac {1}{\left (e-\sqrt {e^2-4 d f}+2 f x\right ) \sqrt {a+b x+c x^2}} \, dx}{\sqrt {e^2-4 d f}}-\frac {(2 f) \int \frac {1}{\left (e+\sqrt {e^2-4 d f}+2 f x\right ) \sqrt {a+b x+c x^2}} \, dx}{\sqrt {e^2-4 d f}} \\ & = -\frac {(4 f) \text {Subst}\left (\int \frac {1}{16 a f^2-8 b f \left (e-\sqrt {e^2-4 d f}\right )+4 c \left (e-\sqrt {e^2-4 d f}\right )^2-x^2} \, dx,x,\frac {4 a f-b \left (e-\sqrt {e^2-4 d f}\right )-\left (-2 b f+2 c \left (e-\sqrt {e^2-4 d f}\right )\right ) x}{\sqrt {a+b x+c x^2}}\right )}{\sqrt {e^2-4 d f}}+\frac {(4 f) \text {Subst}\left (\int \frac {1}{16 a f^2-8 b f \left (e+\sqrt {e^2-4 d f}\right )+4 c \left (e+\sqrt {e^2-4 d f}\right )^2-x^2} \, dx,x,\frac {4 a f-b \left (e+\sqrt {e^2-4 d f}\right )-\left (-2 b f+2 c \left (e+\sqrt {e^2-4 d f}\right )\right ) x}{\sqrt {a+b x+c x^2}}\right )}{\sqrt {e^2-4 d f}} \\ & = -\frac {\sqrt {2} f \tanh ^{-1}\left (\frac {4 a f-b \left (e-\sqrt {e^2-4 d f}\right )+2 \left (b f-c \left (e-\sqrt {e^2-4 d f}\right )\right ) x}{2 \sqrt {2} \sqrt {c e^2-2 c d f-b e f+2 a f^2-(c e-b f) \sqrt {e^2-4 d f}} \sqrt {a+b x+c x^2}}\right )}{\sqrt {e^2-4 d f} \sqrt {c e^2-2 c d f-b e f+2 a f^2-(c e-b f) \sqrt {e^2-4 d f}}}+\frac {\sqrt {2} f \tanh ^{-1}\left (\frac {4 a f-b \left (e+\sqrt {e^2-4 d f}\right )+2 \left (b f-c \left (e+\sqrt {e^2-4 d f}\right )\right ) x}{2 \sqrt {2} \sqrt {c e^2-2 c d f-b e f+2 a f^2+(c e-b f) \sqrt {e^2-4 d f}} \sqrt {a+b x+c x^2}}\right )}{\sqrt {e^2-4 d f} \sqrt {c e^2-2 c d f-b e f+2 a f^2+(c e-b f) \sqrt {e^2-4 d f}}} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.

Time = 0.01 (sec) , antiderivative size = 218, normalized size of antiderivative = 0.58 \[ \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+e x+f x^2\right )} \, dx=-\text {RootSum}\left [c^2 d-b c e+b^2 f+2 \sqrt {a} c e \text {$\#$1}-4 \sqrt {a} b f \text {$\#$1}-2 c d \text {$\#$1}^2+b e \text {$\#$1}^2+4 a f \text {$\#$1}^2-2 \sqrt {a} e \text {$\#$1}^3+d \text {$\#$1}^4\&,\frac {c \log (x)-c \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right )-\log (x) \text {$\#$1}^2+\log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right ) \text {$\#$1}^2}{\sqrt {a} c e-2 \sqrt {a} b f-2 c d \text {$\#$1}+b e \text {$\#$1}+4 a f \text {$\#$1}-3 \sqrt {a} e \text {$\#$1}^2+2 d \text {$\#$1}^3}\&\right ] \]

[In]

Integrate[1/(Sqrt[a + b*x + c*x^2]*(d + e*x + f*x^2)),x]

[Out]

-RootSum[c^2*d - b*c*e + b^2*f + 2*Sqrt[a]*c*e*#1 - 4*Sqrt[a]*b*f*#1 - 2*c*d*#1^2 + b*e*#1^2 + 4*a*f*#1^2 - 2*
Sqrt[a]*e*#1^3 + d*#1^4 & , (c*Log[x] - c*Log[-Sqrt[a] + Sqrt[a + b*x + c*x^2] - x*#1] - Log[x]*#1^2 + Log[-Sq
rt[a] + Sqrt[a + b*x + c*x^2] - x*#1]*#1^2)/(Sqrt[a]*c*e - 2*Sqrt[a]*b*f - 2*c*d*#1 + b*e*#1 + 4*a*f*#1 - 3*Sq
rt[a]*e*#1^2 + 2*d*#1^3) & ]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(760\) vs. \(2(330)=660\).

Time = 0.83 (sec) , antiderivative size = 761, normalized size of antiderivative = 2.03

method result size
default \(\frac {\sqrt {2}\, \ln \left (\frac {\frac {-b f \sqrt {-4 d f +e^{2}}+\sqrt {-4 d f +e^{2}}\, c e +2 a \,f^{2}-b e f -2 c d f +c \,e^{2}}{f^{2}}+\frac {\left (-c \sqrt {-4 d f +e^{2}}+b f -c e \right ) \left (x +\frac {e +\sqrt {-4 d f +e^{2}}}{2 f}\right )}{f}+\frac {\sqrt {2}\, \sqrt {\frac {-b f \sqrt {-4 d f +e^{2}}+\sqrt {-4 d f +e^{2}}\, c e +2 a \,f^{2}-b e f -2 c d f +c \,e^{2}}{f^{2}}}\, \sqrt {4 {\left (x +\frac {e +\sqrt {-4 d f +e^{2}}}{2 f}\right )}^{2} c +\frac {4 \left (-c \sqrt {-4 d f +e^{2}}+b f -c e \right ) \left (x +\frac {e +\sqrt {-4 d f +e^{2}}}{2 f}\right )}{f}+\frac {-2 b f \sqrt {-4 d f +e^{2}}+2 \sqrt {-4 d f +e^{2}}\, c e +4 a \,f^{2}-2 b e f -4 c d f +2 c \,e^{2}}{f^{2}}}}{2}}{x +\frac {e +\sqrt {-4 d f +e^{2}}}{2 f}}\right )}{\sqrt {-4 d f +e^{2}}\, \sqrt {\frac {-b f \sqrt {-4 d f +e^{2}}+\sqrt {-4 d f +e^{2}}\, c e +2 a \,f^{2}-b e f -2 c d f +c \,e^{2}}{f^{2}}}}-\frac {\sqrt {2}\, \ln \left (\frac {\frac {b f \sqrt {-4 d f +e^{2}}-\sqrt {-4 d f +e^{2}}\, c e +2 a \,f^{2}-b e f -2 c d f +c \,e^{2}}{f^{2}}+\frac {\left (c \sqrt {-4 d f +e^{2}}+b f -c e \right ) \left (x -\frac {-e +\sqrt {-4 d f +e^{2}}}{2 f}\right )}{f}+\frac {\sqrt {2}\, \sqrt {\frac {b f \sqrt {-4 d f +e^{2}}-\sqrt {-4 d f +e^{2}}\, c e +2 a \,f^{2}-b e f -2 c d f +c \,e^{2}}{f^{2}}}\, \sqrt {4 {\left (x -\frac {-e +\sqrt {-4 d f +e^{2}}}{2 f}\right )}^{2} c +\frac {4 \left (c \sqrt {-4 d f +e^{2}}+b f -c e \right ) \left (x -\frac {-e +\sqrt {-4 d f +e^{2}}}{2 f}\right )}{f}+\frac {2 b f \sqrt {-4 d f +e^{2}}-2 \sqrt {-4 d f +e^{2}}\, c e +4 a \,f^{2}-2 b e f -4 c d f +2 c \,e^{2}}{f^{2}}}}{2}}{x -\frac {-e +\sqrt {-4 d f +e^{2}}}{2 f}}\right )}{\sqrt {-4 d f +e^{2}}\, \sqrt {\frac {b f \sqrt {-4 d f +e^{2}}-\sqrt {-4 d f +e^{2}}\, c e +2 a \,f^{2}-b e f -2 c d f +c \,e^{2}}{f^{2}}}}\) \(761\)

[In]

int(1/(c*x^2+b*x+a)^(1/2)/(f*x^2+e*x+d),x,method=_RETURNVERBOSE)

[Out]

1/(-4*d*f+e^2)^(1/2)*2^(1/2)/((-b*f*(-4*d*f+e^2)^(1/2)+(-4*d*f+e^2)^(1/2)*c*e+2*a*f^2-b*e*f-2*c*d*f+c*e^2)/f^2
)^(1/2)*ln(((-b*f*(-4*d*f+e^2)^(1/2)+(-4*d*f+e^2)^(1/2)*c*e+2*a*f^2-b*e*f-2*c*d*f+c*e^2)/f^2+1/f*(-c*(-4*d*f+e
^2)^(1/2)+b*f-c*e)*(x+1/2*(e+(-4*d*f+e^2)^(1/2))/f)+1/2*2^(1/2)*((-b*f*(-4*d*f+e^2)^(1/2)+(-4*d*f+e^2)^(1/2)*c
*e+2*a*f^2-b*e*f-2*c*d*f+c*e^2)/f^2)^(1/2)*(4*(x+1/2*(e+(-4*d*f+e^2)^(1/2))/f)^2*c+4/f*(-c*(-4*d*f+e^2)^(1/2)+
b*f-c*e)*(x+1/2*(e+(-4*d*f+e^2)^(1/2))/f)+2*(-b*f*(-4*d*f+e^2)^(1/2)+(-4*d*f+e^2)^(1/2)*c*e+2*a*f^2-b*e*f-2*c*
d*f+c*e^2)/f^2)^(1/2))/(x+1/2*(e+(-4*d*f+e^2)^(1/2))/f))-1/(-4*d*f+e^2)^(1/2)*2^(1/2)/((b*f*(-4*d*f+e^2)^(1/2)
-(-4*d*f+e^2)^(1/2)*c*e+2*a*f^2-b*e*f-2*c*d*f+c*e^2)/f^2)^(1/2)*ln(((b*f*(-4*d*f+e^2)^(1/2)-(-4*d*f+e^2)^(1/2)
*c*e+2*a*f^2-b*e*f-2*c*d*f+c*e^2)/f^2+(c*(-4*d*f+e^2)^(1/2)+b*f-c*e)/f*(x-1/2/f*(-e+(-4*d*f+e^2)^(1/2)))+1/2*2
^(1/2)*((b*f*(-4*d*f+e^2)^(1/2)-(-4*d*f+e^2)^(1/2)*c*e+2*a*f^2-b*e*f-2*c*d*f+c*e^2)/f^2)^(1/2)*(4*(x-1/2/f*(-e
+(-4*d*f+e^2)^(1/2)))^2*c+4*(c*(-4*d*f+e^2)^(1/2)+b*f-c*e)/f*(x-1/2/f*(-e+(-4*d*f+e^2)^(1/2)))+2*(b*f*(-4*d*f+
e^2)^(1/2)-(-4*d*f+e^2)^(1/2)*c*e+2*a*f^2-b*e*f-2*c*d*f+c*e^2)/f^2)^(1/2))/(x-1/2/f*(-e+(-4*d*f+e^2)^(1/2))))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 11287 vs. \(2 (328) = 656\).

Time = 4.27 (sec) , antiderivative size = 11287, normalized size of antiderivative = 30.18 \[ \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+e x+f x^2\right )} \, dx=\text {Too large to display} \]

[In]

integrate(1/(c*x^2+b*x+a)^(1/2)/(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

Too large to include

Sympy [F]

\[ \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+e x+f x^2\right )} \, dx=\int \frac {1}{\sqrt {a + b x + c x^{2}} \left (d + e x + f x^{2}\right )}\, dx \]

[In]

integrate(1/(c*x**2+b*x+a)**(1/2)/(f*x**2+e*x+d),x)

[Out]

Integral(1/(sqrt(a + b*x + c*x**2)*(d + e*x + f*x**2)), x)

Maxima [F(-2)]

Exception generated. \[ \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+e x+f x^2\right )} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(1/(c*x^2+b*x+a)^(1/2)/(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d*f-e^2>0)', see `assume?` f
or more deta

Giac [F(-1)]

Timed out. \[ \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+e x+f x^2\right )} \, dx=\text {Timed out} \]

[In]

integrate(1/(c*x^2+b*x+a)^(1/2)/(f*x^2+e*x+d),x, algorithm="giac")

[Out]

Timed out

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+e x+f x^2\right )} \, dx=\int \frac {1}{\sqrt {c\,x^2+b\,x+a}\,\left (f\,x^2+e\,x+d\right )} \,d x \]

[In]

int(1/((a + b*x + c*x^2)^(1/2)*(d + e*x + f*x^2)),x)

[Out]

int(1/((a + b*x + c*x^2)^(1/2)*(d + e*x + f*x^2)), x)